//
//  SMSRequestProvider.m
//  SulitLoan
//
//  Created by 虞嘉伟 on 2025/2/26.
//  
  

#import "OrderListRequestProvider.h"
#import "OrderListRequest.h"



@implementation OrderListRequestProvider

+ (void)requestOrderListWithStatus:(NSString *)status success:(void(^)(NSArray<NSDictionary *> *arr))success failure:(void(^)(YTKRequest *request))failure {
    OrderListRequest *request = [OrderListRequest new];
    request.differently = status;
//#ifdef DEBUG
//    request.differently = @"4";
//#endif
    [request startWithCompletionBlockWithSuccess:^(__kindof YTKBaseRequest * _Nonnull request) {
        NSDictionary *dict = request.responseObject;
        if (![dict isKindOfClass:NSDictionary.class]) {
            !failure ?: failure(request);
            return;
        }
        if ([dict[@"weeps"] intValue] == 0) {
            // 成功
            !success ?: success(dict[@"bounding"][@"sensitive"]);
        } else {
            !failure ?: failure(request);
        }
    } failure:^(__kindof YTKBaseRequest * _Nonnull request) {
        !failure ?: failure(request);
    }];
}



@end
